package com.peanut.bosskg.service.other.separate;

import com.alibaba.fastjson.JSON;
import com.peanut.bosskg.entity.ResponseMessageVO;
import com.peanut.bosskg.entity.separate.ApplyRechargeDTO;
import com.peanut.bosskg.entity.separate.ApplyRechargeVo;
import com.peanut.bosskg.enums.FunCodeEnum;
import com.peanut.bosskg.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/***
 *
 *
 * 描    述：申请分账接口
 *
 * 创建时间：2022/6/13下午4:35
 * 创建描述：
 *
 */
@Service
@Slf4j
public class ApplyRechargeService extends BaseService {


    /**
     * @param funCodeEnum
     * @param applyRechargeDTO
     * @return
     * @throws Exception
     */
    public ApplyRechargeVo doBusiness(FunCodeEnum funCodeEnum, ApplyRechargeDTO applyRechargeDTO) throws Exception {
        log.info("用户申请分账接口开始:{}，{}", funCodeEnum, applyRechargeDTO);
        ResponseMessageVO responseMessage = applyYouFuByHttpPost(funCodeEnum, applyRechargeDTO);
        ApplyRechargeVo applyRechargeVo = JSON.parseObject(responseMessage.getResData(), ApplyRechargeVo.class);
        log.info("用户申请分账接口结束:{}", applyRechargeVo);
        return applyRechargeVo;
    }

}
